/**
 * Description:
 * Class Name:VarInLambda2
 * Date:2022/2/12 12:23
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第6章_面向对象_下._6_8_Java11增强的lambda表达式._6_8_3_在Lambda表达式中使用var;

interface Predator{
    void prey(String animal);
}

public class VarInLambda2 {
    public static void main(String[] args) {
        Predator p = (var animal) -> {
            System.out.println("老鹰在捕食：" + animal);
        };
        p.prey("rabbit");
    }
}
